package ipmsg.etc;

import java.io.PrintStream;







public class FileNode
{
  private int fileNo;
  private String fileName;
  private long fileLen;
  private int fileKind;
  private String time;
  private boolean isTransfered = false;
  
  public boolean isIsTransfered() {
    return this.isTransfered;
  }
  
  public void setIsTransfered(boolean isTransfered) {
    this.isTransfered = isTransfered;
  }
  
  public boolean setFileKind(int fileKind) {
    if ((fileKind == 1) || (fileKind == 2) || (fileKind == 3))
    {

      this.fileKind = fileKind;
      return true; }
    return false;
  }
  
  public boolean setFileKind(String fileKind) {
    try { return setFileKind(Integer.parseInt(fileKind, 16));
    }
    catch (NumberFormatException e) {}
    
    return false;
  }
  


  public void setFileLen(long fileLen) { this.fileLen = fileLen; }
  
  public boolean setFileLen(String fileLen) {
    try {
      setFileLen(Integer.parseInt(fileLen, 16));
      return true;
    } catch (NumberFormatException e) {}
    return false;
  }
  
  public void setFileName(String fileName)
  {
    if (fileName.length() >= 200)
      fileName = fileName.substring(0, 200);
    this.fileName = fileName;
  }
  

  public void setFileNo(int fileNo) { this.fileNo = fileNo; }
  
  public boolean setFileNo(String fileNo) {
    try {
      setFileNo(Integer.parseInt(fileNo, 16));
      return true;
    } catch (NumberFormatException e) {}
    return false;
  }
  
  public void setTime(String time)
  {
    this.time = time;
  }
  
  public int getFileKind() {
    return this.fileKind;
  }
  
  public long getFileLen() {
    return this.fileLen;
  }
  
  public String getFileName() {
    return this.fileName;
  }
  
  public int getFileNo() {
    return this.fileNo;
  }
  
  public String getTime() {
    return this.time;
  }
  
  public void show() {
    System.out.println("文件名 ：" + this.fileName);
    System.out.println("文件长度 ： " + this.fileLen);
    System.out.println("文件类型 : " + this.fileKind);
  }
}
